within BusinessSimulation.Interfaces.Basics;

partial model GenericSensor "Generic sensor with connection to the ports of a stock"
  Connectors.RealOutput inFlow "Current rate of inflow" annotation(Placement(visible = true, transformation(origin = {160, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-100, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Connectors.RealOutput outFlow "Current rate of outflow" annotation(Placement(visible = true, transformation(origin = {160, -80}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Connectors.RealOutput stock "Current level of stock" annotation(Placement(visible = true, transformation(origin = {160, 38.364}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-49.512, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Connectors.RealOutput netFlow "Current netflow" annotation(Placement(visible = true, transformation(origin = {160, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {50.237, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Connectors.RealOutput meanResidenceTime "Mean Residence Time" annotation(Placement(visible = true, transformation(origin = {160, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0.237, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  Connectors.StockInfoInput u_stockInfo annotation(Placement(visible = true, transformation(origin = {-145, -0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, -40}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
  annotation(Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>Partial model with a&nbsp;&rarr;<a href=\"modelica://BusinessSimulation.Interfaces.Connectors.StockInfoInput\">StockInfoInput </a>connector and five Real output connectors. The class is extended by sensor components that \"measure\" stock-related information.</p>
<h4>See also</h4>
<p><a href=\"modelica://BusinessSimulation.Sensors.AbsoluteSensor\">AbsoluteSensor</a></p></html>"), Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Line(visible = true, origin = {-19.625, -53.619}, points = {{-74, 53.619}, {100, 53.619}, {126, 53.619}}, color = {0, 0, 128}, thickness = 5), Ellipse(visible = true, origin = {-100, 0}, rotation = 30, lineColor = {0, 0, 128}, fillColor = {76, 112, 136}, fillPattern = FillPattern.Solid, lineThickness = 3, extent = {{-20.708, -20.708}, {20.708, 20.708}}), Line(visible = true, origin = {-114.33, 7.5}, rotation = -300, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-108.5, 13.33}, rotation = 30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-99.781, 16.375}, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-102.624, 3.453}, rotation = -300, points = {{2.435, 4.688}, {-2.435, -4.688}}, color = {255, 0, 0}, thickness = 1), Line(visible = true, origin = {-86.143, 8.141}, rotation = 660, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-92.078, 14.346}, rotation = -30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-116, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-84, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Text(visible = true, origin = {-100, -10}, textColor = {255, 255, 255}, extent = {{-12.617, -6}, {12.617, 6}}, textString = "IN", fontName = "Lato", textStyle = {TextStyle.Bold}), Ellipse(visible = true, origin = {-99.903, 0}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-3, -3}, {3, 3}}), Ellipse(visible = true, origin = {100, 0}, rotation = 30, lineColor = {0, 0, 128}, fillColor = {76, 112, 136}, fillPattern = FillPattern.Solid, lineThickness = 3, extent = {{-20.708, -20.708}, {20.708, 20.708}}), Line(visible = true, origin = {85.67, 7.5}, rotation = -300, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {91.5, 13.33}, rotation = 30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {100.219, 16.375}, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {97.376, 3.453}, rotation = -300, points = {{2.435, 4.688}, {-2.435, -4.688}}, color = {255, 0, 0}, thickness = 1), Line(visible = true, origin = {113.857, 8.141}, rotation = 660, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {107.922, 14.346}, rotation = -30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {84, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {116, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Text(visible = true, origin = {100, -10}, textColor = {255, 255, 255}, extent = {{-12.617, -6}, {12.617, 6}}, textString = "OUT", fontName = "Lato", textStyle = {TextStyle.Bold}), Ellipse(visible = true, origin = {100.097, 0}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-3, -3}, {3, 3}}), Ellipse(visible = true, origin = {-50, 0}, rotation = 30, lineColor = {0, 0, 128}, fillColor = {76, 112, 136}, fillPattern = FillPattern.Solid, lineThickness = 3, extent = {{-20.708, -20.708}, {20.708, 20.708}}), Line(visible = true, origin = {-64.33, 7.5}, rotation = -300, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-58.5, 13.33}, rotation = 30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-49.781, 16.375}, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-52.624, 3.453}, rotation = -300, points = {{2.435, 4.688}, {-2.435, -4.688}}, color = {255, 0, 0}, thickness = 1), Line(visible = true, origin = {-36.143, 8.141}, rotation = 660, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-42.078, 14.346}, rotation = -30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-66, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-34, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Text(visible = true, origin = {-50, -10}, textColor = {255, 255, 255}, extent = {{-12.617, -6}, {12.617, 6}}, textString = "S", fontName = "Lato", textStyle = {TextStyle.Bold}), Ellipse(visible = true, origin = {-49.903, 0}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-3, -3}, {3, 3}}), Ellipse(visible = true, origin = {50, 0}, rotation = 30, lineColor = {0, 0, 128}, fillColor = {76, 112, 136}, fillPattern = FillPattern.Solid, lineThickness = 3, extent = {{-20.708, -20.708}, {20.708, 20.708}}), Line(visible = true, origin = {35.67, 7.5}, rotation = -300, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {41.5, 13.33}, rotation = 30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {50.219, 16.375}, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {47.376, 3.453}, rotation = -300, points = {{2.435, 4.688}, {-2.435, -4.688}}, color = {255, 0, 0}, thickness = 1), Line(visible = true, origin = {63.857, 8.141}, rotation = 660, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {57.922, 14.346}, rotation = -30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {34, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {66, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Text(visible = true, origin = {50, -10}, textColor = {255, 255, 255}, extent = {{-12.617, -6}, {12.617, 6}}, textString = "F", fontName = "Lato", textStyle = {TextStyle.Bold}), Ellipse(visible = true, origin = {50.097, 0}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-3, -3}, {3, 3}}), Ellipse(visible = true, rotation = 30, lineColor = {0, 0, 128}, fillColor = {76, 112, 136}, fillPattern = FillPattern.Solid, lineThickness = 3, extent = {{-20.708, -20.708}, {20.708, 20.708}}), Line(visible = true, origin = {-14.33, 7.5}, rotation = -300, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-8.5, 13.33}, rotation = 30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {0.219, 16.375}, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-2.624, 3.453}, rotation = -300, points = {{2.435, 4.688}, {-2.435, -4.688}}, color = {255, 0, 0}, thickness = 1), Line(visible = true, origin = {13.857, 8.141}, rotation = 660, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {7.922, 14.346}, rotation = -30, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {-16, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Line(visible = true, origin = {16, 0}, rotation = -270, points = {{0, 3}, {0, -3}}, color = {255, 255, 255}, thickness = 1), Text(visible = true, origin = {0, -10}, textColor = {255, 255, 255}, extent = {{-12.617, -6}, {12.617, 6}}, textString = "MRT", fontName = "Lato", textStyle = {TextStyle.Bold}), Ellipse(visible = true, origin = {0.097, 0}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, extent = {{-3, -3}, {3, 3}})}), Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})));
end GenericSensor;
